<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

    Route::get('/','Home\IndexController@index');
    Route::get('cate/{cate_id}','Home\IndexController@cate');
    Route::get('a/{art_id}','Home\IndexController@article');
    //后台登录
        Route::any('admin/login','Admin\LoginController@login');
    //验证码
        Route::get('admin/code','Admin\LoginController@code');


    Route::group(['middleware'=>['admin.login'],'prefix'=>'admin','namespace'=>'Admin'],function(){
    Route::get('/','IndexController@index');
    Route::get('info','IndexController@info');
    Route::get('quit','LoginController@quit');
    Route::any('pass','IndexController@pass');
    Route::post('cate/changeorder','CategoryController@changeOrder');
    //分类
    Route::resource('category','CategoryController');
    //文章
    Route::resource('article','ArticleController');
    //友情链接
    Route::post('links/changeorder','LinksController@changeOrder');
    Route::resource('links','LinksController');
    //自定义导航
    Route::post('navs/changeorder','NavsController@changeOrder');
    Route::resource('navs','NavsController');
    //网站配置
        Route::get('config/putfile','ConfigController@putFile');
        Route::post('config/changeorder','ConfigController@changeOrder');
        Route::post('config/changecontent','ConfigController@changeContent');
        Route::resource('config','ConfigController');
        //上传
    Route::any('upload','CommonController@upload');
});


